<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
	html, body {
		height: 100%;
	}

	button {
		border: 1px solid rgba(0, 0, 0, .1);
		border-radius: 2px;
		background-color: transparent;
		outline: none;
		padding: 4px 12px;
		font-size: 12px;
		position: relative;
		cursor: pointer;
	}
	button:after {
		content: '';
		display: block;
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		background-color: transparent;
		transition: background-color .5s ease;
	}
	button:hover::after {
		background-color: rgba(0, 0, 0, .05);
	}
	button:active::after {
		transition: background-color .1s ease;
		background-color: rgba(0, 0, 0, .15);
	}

	.blue { background-color: blue }
	.red { background-color: red }
	.yellow { background-color: yellow }


	</style>
</head>
<body>
	<button>OK</button>
	<button class="blue">Blue</button>
	<button class="red">Red</button>
	<button class="yellow">Yellow</button>
</body>
</html>